package cn.qqtheme.framework.util;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.view.View;

/* loaded from: classes.dex */
public class CompatUtils {
    public static void setBackground(View view, Drawable drawable) {
        if (Build.VERSION.SDK_INT < 16) {
            view.setBackgroundDrawable(drawable);
        } else {
            view.setBackground(drawable);
        }
    }

    public static Drawable getDrawable(Context context, int i) {
        if (Build.VERSION.SDK_INT < 21) {
            return context.getResources().getDrawable(i);
        }
        return context.getDrawable(i);
    }
}
